package com.eightbears.beboy.ui.user.activity;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.widget.TextView;

import com.eightbears.beboy.R;
import com.eightbears.beboy.adapter.OrderListViewPagerAdapter;
import com.eightbears.beboy.base.BaseActivity;
import com.eightbears.beboy.base.view.SwipeBackLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class OrderListActivity extends BaseActivity {

    @BindView(R.id.tv_title)
    TextView tv_title;
    @BindView(R.id.sw_finish)
    SwipeBackLayout sw_finish;
    @BindView(R.id.tl_top)
    TabLayout tl_top;
    @BindView(R.id.vp_content)
    ViewPager vp_content;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_order_list);

        initView();
        initData();
        initEvent();
    }

    @Override
    protected void initView() {
        ButterKnife.bind(this);
        tv_title.setText(R.string.text_my_order_title);
        vp_content.setAdapter(new OrderListViewPagerAdapter(mContext, getSupportFragmentManager()));
        tl_top.setupWithViewPager(vp_content);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initEvent() {
        sw_finish.setCallBack(new SwipeBackLayout.CallBack() {
            @Override
            public void onFinish() {
                finish();
            }
        });

    }

    @OnClick(R.id.ll_back)
    void back() {
        finish();
    }

}